class Solution(object):
    def pivotIndex(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        l = 0
        r =sum(nums)
        for i in range(len(nums)):
            if l*2+nums[i]==r:
                return True
            l+=nums[i]
        return False


a=[1, 7, 3, 6, 5, 6]

s=Solution()
m =s.pivotIndex(a)
print(m)